/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package pvt.delez.pam.virgin.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import pvt.delez.pam.virgin.ClassPathEntry;
import pvt.delez.pam.virgin.ClassPathEntryKind;
import pvt.delez.pam.virgin.VirginPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Class Path Entry</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link pvt.delez.pam.virgin.impl.ClassPathEntryImpl#getKind <em>Kind</em>}</li>
 *   <li>{@link pvt.delez.pam.virgin.impl.ClassPathEntryImpl#getPath <em>Path</em>}</li>
 *   <li>{@link pvt.delez.pam.virgin.impl.ClassPathEntryImpl#isCombineAccessRules <em>Combine Access Rules</em>}</li>
 * </ul>
 *
 * @generated
 */
public class ClassPathEntryImpl extends EObjectImpl implements ClassPathEntry {
	/**
	 * The default value of the '{@link #getKind() <em>Kind</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getKind()
	 * @generated
	 * @ordered
	 */
	protected static final ClassPathEntryKind KIND_EDEFAULT = ClassPathEntryKind.SRC;

	/**
	 * The cached value of the '{@link #getKind() <em>Kind</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getKind()
	 * @generated
	 * @ordered
	 */
	protected ClassPathEntryKind kind = KIND_EDEFAULT;

	/**
	 * The default value of the '{@link #getPath() <em>Path</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPath()
	 * @generated
	 * @ordered
	 */
	protected static final String PATH_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getPath() <em>Path</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPath()
	 * @generated
	 * @ordered
	 */
	protected String path = PATH_EDEFAULT;

	/**
	 * The default value of the '{@link #isCombineAccessRules() <em>Combine Access Rules</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isCombineAccessRules()
	 * @generated
	 * @ordered
	 */
	protected static final boolean COMBINE_ACCESS_RULES_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isCombineAccessRules() <em>Combine Access Rules</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isCombineAccessRules()
	 * @generated
	 * @ordered
	 */
	protected boolean combineAccessRules = COMBINE_ACCESS_RULES_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ClassPathEntryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return VirginPackage.Literals.CLASS_PATH_ENTRY;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ClassPathEntryKind getKind() {
		return kind;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setKind(ClassPathEntryKind newKind) {
		ClassPathEntryKind oldKind = kind;
		kind = newKind == null ? KIND_EDEFAULT : newKind;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, VirginPackage.CLASS_PATH_ENTRY__KIND, oldKind, kind));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getPath() {
		return path;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPath(String newPath) {
		String oldPath = path;
		path = newPath;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, VirginPackage.CLASS_PATH_ENTRY__PATH, oldPath, path));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isCombineAccessRules() {
		return combineAccessRules;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCombineAccessRules(boolean newCombineAccessRules) {
		boolean oldCombineAccessRules = combineAccessRules;
		combineAccessRules = newCombineAccessRules;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, VirginPackage.CLASS_PATH_ENTRY__COMBINE_ACCESS_RULES, oldCombineAccessRules, combineAccessRules));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case VirginPackage.CLASS_PATH_ENTRY__KIND:
				return getKind();
			case VirginPackage.CLASS_PATH_ENTRY__PATH:
				return getPath();
			case VirginPackage.CLASS_PATH_ENTRY__COMBINE_ACCESS_RULES:
				return isCombineAccessRules();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case VirginPackage.CLASS_PATH_ENTRY__KIND:
				setKind((ClassPathEntryKind)newValue);
				return;
			case VirginPackage.CLASS_PATH_ENTRY__PATH:
				setPath((String)newValue);
				return;
			case VirginPackage.CLASS_PATH_ENTRY__COMBINE_ACCESS_RULES:
				setCombineAccessRules((Boolean)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case VirginPackage.CLASS_PATH_ENTRY__KIND:
				setKind(KIND_EDEFAULT);
				return;
			case VirginPackage.CLASS_PATH_ENTRY__PATH:
				setPath(PATH_EDEFAULT);
				return;
			case VirginPackage.CLASS_PATH_ENTRY__COMBINE_ACCESS_RULES:
				setCombineAccessRules(COMBINE_ACCESS_RULES_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case VirginPackage.CLASS_PATH_ENTRY__KIND:
				return kind != KIND_EDEFAULT;
			case VirginPackage.CLASS_PATH_ENTRY__PATH:
				return PATH_EDEFAULT == null ? path != null : !PATH_EDEFAULT.equals(path);
			case VirginPackage.CLASS_PATH_ENTRY__COMBINE_ACCESS_RULES:
				return combineAccessRules != COMBINE_ACCESS_RULES_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (Kind: ");
		result.append(kind);
		result.append(", Path: ");
		result.append(path);
		result.append(", CombineAccessRules: ");
		result.append(combineAccessRules);
		result.append(')');
		return result.toString();
	}

} //ClassPathEntryImpl
